﻿#include "core.h"
#include "mboyermoore.h"
#include "msort.h"
#include <QDebug>

Core::Core()
{
    
}

void Core::Test()
{
    int a=10,b=0,c=0,d=0;
    a = 5;
    b=a++;
    c=++a;
    d=10*a++;
    printf("a,b,c,d: %d,%d,%d,%d",a,b,c,d);
    fflush(stdout);
    
    int t1=2,t2=3;
    printf("\n==111------t1=%d,t2=%d",t1,t2);
    t1 = t1+t2;
    t2 = t1 - t2;
    t1 = t1-t2;
    printf("\n==222-----t1=%d,t2=%d",t1,t2);
    fflush(stdout);
    
    char c1=70;
    char c2 = c1<<4;
    char c3 = c1>>4;
    char cV[10];
    itoa(c1,cV,2);
    printf("\nc1=%s,c2=%d,c3=%d,d=%d",cV,c2,c3,c2+c3);
    fflush(stdout);
}

void Core::BoyerMoreTest()
{
    MBoyerMoore bm;
    bm.startForText_c();
}

void Core::sortTest()
{
    MSort sort;
    sort.test();;
}
